﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibFriesland_Campina_CRM
{
    public class BizProductInShop
    {
        #region Thuoc tinh
        public string by_shop { get; set; }
        public string by_product { get; set; }
        public int quantity { get; set; }
        public decimal price_in_shop { get; set; }
        #endregion

        #region Ham thiet lap
        public BizProductInShop() { }
        public BizProductInShop(string pBy_shop, string pBy_product, int pQuantiy)
        {
            by_shop = pBy_shop;
            by_product = pBy_product;
            quantity = pQuantiy;
            price_in_shop = 0;
        }
        public BizProductInShop(string pBy_shop, string pBy_product, int pQuantity, decimal pPrice_in_shop) 
        {
            by_shop = pBy_shop;
            by_product = pBy_product;
            quantity = pQuantity;
            price_in_shop = pPrice_in_shop;
        }
        #endregion

        #region Phuong thuc
        //Cap nhat so luong cua mot san pham trong Shop
        public static int updateProductQuantityInShop(string pBy_product, string pBy_shop, int pQuantity)
        {
            return DalProductInshop.updateProductQuantityInShop(pBy_product, pBy_shop, pQuantity);
        }

        //Lay so luong hien tai cua san pham trong Shop
        public static int getProductQuantityInShop(string pBy_product, string pBy_shop)
        {
            return DalProductInshop.getProductQuantityInShop(pBy_product, pBy_shop);
        }

        //Cap nhat gia san pham tai cua hang
        public static int updateProductPriceInShop(string pBy_product, string pBy_shop, decimal pPrice)
        {
            return DalProductInshop.updateProductPriceInShop(pBy_product, pBy_shop, pPrice);
        }
        #endregion
    }
}
